Here is a documentstylestyle option that allows you to customize your page headers and footers in an easy way. It combines features that were separately available in other pagestyles, without introducing much complexity. You can define: - three-part headers and footers - rules in header and footer - headers and footers wider than - multiline headers and footers - separate headers and footers for even and odd pages - separate headers and footers for chapter pages

To use this pagestyle, you must include the ``fancyheadings'' style option in your and issue the command.The command should be issued after any changes made toThe page layout will be as follows: LHEAD CHEAD RHEAD ———————————– (rule) page body ———————————– (rule) LFOOT CFOOT RFOOTThe L-fields will be leftadjusted, the C-fields centered and theR-fields rightadjusted.Each of the six fields and the two rules can be defined separately.Simple use:The header and footer fields can be defined by commands LHEADand so on for the other fields. If the field depends on something in thedocument (e.g. section titles) you must in general use the dommands, otherwise a title may end on the wrong page. Youcan do this e.g. by redefining the commands , so on (see example below). The defaults for these marks are as inthe standard pagestyles. The marks can be put into a header or footerfield by referencing and .Rules in header and footerThe thickness of the rules below the header and above the footer can bechanged by redefining the length parameters (default0.4pt) and (default 0). These may be redefined by the command. A thickness of 0pt makes the rule invisible.If you want to make more complicated changes, you have to redefine thecommands to 0ptto&dotfill#dotfill;and/or .E.g. If you want a dotted line rather than a ruler you can give thecommand:Headers and footers wider than headers and footers are set in a box of width . Thedefault for this is the value of You can make it wider (orsmaller) by redefining with the or . The headers and footers will stick out the page on the sameside as the marginal notes. For example to include the marginal notes,add both and to (see also theexample below).Multiline headers and footersEach of the six fields is set in an appropriate parbox, so you can put amultiline part in it with the
command. It is also possible to putextra space in it with the
ommand. Note that if you do this youwill probably have to increase the or lengths.Separate headers and footers for even and odd pagesIf you want the headers and footers to be different on even- andodd-numbered pages in the ``twoside'' style, the field-defining macroscan be given an optional argument, to be used on the even-numberedpages, like [EVEN-LHEAD]ODD-LHEAD.Separate headers and footers for chapter pagesLaTeX gives a command for the first page of thedocument, the first page of each chapter and a couple of other pages. Itmight be incompatible with your pagestyle. In this case you can use aslightly different version of the pagestyle, called . This pagestyle redefines the pagestyle ``plain'' to also use pagestyle``fancy'' with the following modifications: - the thicknesses of the rules is defined by and (both default 0). - the 6 fields may be defined separately for the plain pages by giving them the value PLAIN-VALUENORMAL-VALUE. This construct may be used in both the optional argument and the normal argument. Thus [F1F2]F3F4 specifies the LHEAD value in a two-sided document: F1 on an even-numbered ``plain'' page F2 on an even-numbered normal page F3 on an odd-numbered ``plain'' page F4 on an odd-numbered normal page.Defaults:0.4pt0pt0pt0pt[][] Examples:To put two lines containing the section title and the subsection titlein the righthandside corner, use:

The following definitions give an approximation of the style used in the LaTeX book:

[] []

Using section titles etc. in the headers and/or footers:

You can't just change the header and/or footer fields in the middle of some text (e.g. after a section header). This is because TeX may have processed a bit more text before deciding to make up the page. It may have passed a section beginning, causing the wrong title on the page. TeX has a mechanism called 'marks' to solve this problem. There is in LaTeX a and a . Usually is a chapter title and is a section title. To set the marks there are two commands: sets the to L and the rightmark to R, and R sets only the rightmark to R. The default definitions of . do this already for you.

An example follows:

left page right page ——— ———-

2 CHAPTER 1. Introduction | 1.2 Some section 3 ———————————— | —————————————– | Text | more text Text | more text Text | more text | | |

This can be easily done with fancyheadings as follows:

[] []

This specifies that on even pages (the [] parts) the leftheadpart is page number and rightheadpart is , which is the chapter title (because that is given as the left argument of ee page 162 of the LaTeX book)

On odd pages (the parts between ) the leftheadpart is (which is the last section title because that is given as argument to see the same page), and the rightheadpart is the page no.

Now suppose you don't want the section number and you want the section title in upper case: You add the following to your preamble:

Or if you don't want the chapter number but only the chapter title (not in uppercase):

Note: the parameter in both cases is the (section|chapter) title.

KNOWN PROBLEMS:

Sometimes you will get a warning message from LaTeX concerning ``overfull vbox during output''. In this case you have to increase the or lengths or both (with or ).

If you want to use fancyheadings with the letter style, you must put the following command in the beginning of your document: